import { Component, OnInit } from '@angular/core';
import { User } from 'src/app/user';
import { RouteService } from '../../test/route.service';
import { ShareService } from 'src/app/share/share.service';

@Component({
  selector: 'app-userlist',
  templateUrl: './userlist.component.html',
  styleUrls: ['./userlist.component.css']
})
export class UserlistComponent implements OnInit {

  users: User[];
  constructor(private routeService: RouteService,
    private shareService: ShareService) { 
      shareService.test()
    }

  ngOnInit() {
    this.routeService.getUsers().subscribe(users => {
      this.users = users;
    });
  }

}
